package org.zhouhe.vo;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * User entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "user", catalog = "zpd0t1_db")
public class User implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = 1080563430583146835L;
	private Integer userId;
	private String loginName;
	private String loginPwd;
	private String realName;
	private Timestamp insertTime;
	private Integer status;
	private Set<HotProject> hotProjects = new HashSet<HotProject>(0);
	private Set<ServingProcess> servingProcesses = new HashSet<ServingProcess>(0);
	private Set<HotInfo> hotInfos = new HashSet<HotInfo>(0);
	private Set<UserRole> userRoles = new HashSet<UserRole>(0);
	private Set<Article> articles = new HashSet<Article>(0);
	private Set<Report> reports = new HashSet<Report>(0);

	// Constructors

	/** default constructor */
	public User() {
	}

	/** full constructor */
	public User(String loginName, String loginPwd, String realName, Timestamp insertTime, Integer status, Set<HotProject> hotProjects,
			Set<ServingProcess> servingProcesses, Set<HotInfo> hotInfos, Set<UserRole> userRoles, Set<Article> articles, Set<Report> reports) {
		this.loginName = loginName;
		this.loginPwd = loginPwd;
		this.realName = realName;
		this.insertTime = insertTime;
		this.status = status;
		this.hotProjects = hotProjects;
		this.servingProcesses = servingProcesses;
		this.hotInfos = hotInfos;
		this.userRoles = userRoles;
		this.articles = articles;
		this.reports = reports;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "user_id", unique = true, nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "login_name", length = 128)
	public String getLoginName() {
		return this.loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	@Column(name = "login_pwd", length = 128)
	public String getLoginPwd() {
		return this.loginPwd;
	}

	public void setLoginPwd(String loginPwd) {
		this.loginPwd = loginPwd;
	}

	@Column(name = "real_name", length = 128)
	public String getRealName() {
		return this.realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	@Column(name = "insert_time", length = 19)
	public Timestamp getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Timestamp insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<HotProject> getHotProjects() {
		return this.hotProjects;
	}

	public void setHotProjects(Set<HotProject> hotProjects) {
		this.hotProjects = hotProjects;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<ServingProcess> getServingProcesses() {
		return this.servingProcesses;
	}

	public void setServingProcesses(Set<ServingProcess> servingProcesses) {
		this.servingProcesses = servingProcesses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<HotInfo> getHotInfos() {
		return this.hotInfos;
	}

	public void setHotInfos(Set<HotInfo> hotInfos) {
		this.hotInfos = hotInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<UserRole> getUserRoles() {
		return this.userRoles;
	}

	public void setUserRoles(Set<UserRole> userRoles) {
		this.userRoles = userRoles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Article> getArticles() {
		return this.articles;
	}

	public void setArticles(Set<Article> articles) {
		this.articles = articles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Report> getReports() {
		return this.reports;
	}

	public void setReports(Set<Report> reports) {
		this.reports = reports;
	}

}